package kn.webstd.g4g.business;

import java.util.Collection;
import java.util.List;
import kn.webstd.g4g.commons.dts.ActivityDts;
import kn.webstd.g4g.commons.dts.BUDts;
import kn.webstd.g4g.commons.dts.CorrectiveActionDts;
import kn.webstd.g4g.commons.dts.GraphicDts;
import kn.webstd.g4g.commons.dts.IniciativeDts;
import kn.webstd.g4g.commons.dts.MonthlyprogressDts;
import kn.webstd.g4g.commons.dts.ProgramDts;
import kn.webstd.g4g.commons.dts.StatusDts;
import kn.webstd.g4g.commons.dts.UsersDts;
import kn.webstd.tools.business.IService;
import kn.webstd.tools.business.security.IAuthorizationManager.PermitAll;

@PermitAll
public interface IActivityService extends IService {
	public ActivityDts getActivity(ActivityDts activity, StatusDts period);
	public MonthlyprogressDts getMonthlyprogressByActivity(ActivityDts activity, StatusDts period);
	public List<CorrectiveActionDts> getCorrectiveActionsByActivity(ActivityDts activity, StatusDts period);
	public List<ActivityDts> getAllActivitiesByProgram(ProgramDts program, StatusDts period);
	public List<ActivityDts> getAllActivitiesByProgramHistoric(ProgramDts program);
	public List<ActivityDts> getAllActivitiesByParentActivity(ActivityDts activity, StatusDts period);
	public ActivityDts calculateSemaphoreActivity(ActivityDts activity, StatusDts period);
	public ActivityDts calculateSemaphoreActivityWithRefresh(ActivityDts activity, StatusDts period);
	public ActivityDts calculateSuggestTargetActivityParent(ActivityDts activity, StatusDts period);
	public double getTotalDaysBetween(ActivityDts activity);
	public String getActivityResponsible(ActivityDts activity, StatusDts period);
	public ActivityDts getActivityParentByActivity(ActivityDts activity, StatusDts period);
	public ProgramDts getProgramByActivity(ActivityDts activity, StatusDts period);
	public List<ActivityDts> getPriorityActivitiesByUser(UsersDts user, StatusDts period);
	public List<ActivityDts> getPriorityActivitiesByUserNotFinished(UsersDts user, StatusDts period);
	public List<ActivityDts> getPriorityActivitiesByBU(BUDts bu, StatusDts period);
	public List<ActivityDts> getActivityTrend(ActivityDts activity, StatusDts period);
	public ActivityDts terminateActivityByUser(UsersDts user);
	public List<MonthlyprogressDts> getAllMonthlyProgressByStatusAndNotFinished(StatusDts beforePeriod);
	public List<MonthlyprogressDts> createNewMonthlyProgressWhitChangePeriod(StatusDts beforePeriod);
	public MonthlyprogressDts terminateMonthlyprogressByUser(UsersDts user);
	public List<ActivityDts> getAllActivitiesByProgram(ProgramDts program);
	public List<GraphicDts> generateActivityGraphic(StatusDts initStatus, StatusDts endStatus, ActivityDts activity);
	
	
	public List<MonthlyprogressDts> getAllMonthlyProgressByStatus(StatusDts period);
	public ActivityDts getActivityByMonthlyProgress(MonthlyprogressDts monthly, StatusDts period);
	public ActivityDts getLastParent(ActivityDts child, StatusDts period);
	public List<ActivityDts> getAllParentsByChildrenActivities(List<ActivityDts> children, List<ActivityDts> parents, StatusDts period);
	
	// Get GAP for calculate Semaphore (generic)
	public ActivityDts calculateGAP(ActivityDts parentActivity, StatusDts period);
	public List<ActivityDts> getChildrenByParentActivity(ActivityDts parentActivity);
	
	
	// Pilar S.
	public MonthlyprogressDts updateActivity(MonthlyprogressDts activityDts, Collection<CorrectiveActionDts> correctiveactionsDts);
	public MonthlyprogressDts submitActivity(MonthlyprogressDts activityDts, Collection<CorrectiveActionDts> correctiveactionsDts);
	public MonthlyprogressDts getMontryprogresByIdActivityAndIdStatus(MonthlyprogressDts monthlyprogressDts);
	public StatusDts getCurrentStatus();
	public long getNoActionVigentes(ActivityDts activity);
	ActivityDts updateEvent(ActivityDts activityDts);
	IniciativeDts saveIniciativebu(IniciativeDts iniciativeDts);
	List<ActivityDts> getAllActivitiesForResponsible(UsersDts userDts, StatusDts period);
	List<ActivityDts> getAllActivitiesWithCorrectiActionByProgram(ProgramDts programDts, StatusDts period);
	List<CorrectiveActionDts> getCorrectiveActionsByActivityAndStatus(ActivityDts activity, StatusDts period);
	ActivityDts getModifiedActivityByIdActivityAndIdStatus(ActivityDts activityDts, StatusDts period);
}